![]() |
Sensor Fusion for Kinetis MCUs (ISSDK/KSDK version)
|
Include dependency graph for orientation.c:Go to the source code of this file.
Macros | |
| #define | SMALLQ0 1E-4F |
| #define | CORRUPTQUAT 0.001F |
| #define | SMALLMODULUS 0.01F |
Functions | |
| void | f3DOFMagnetometerMatrixNED (float fR[][3], float fBc[]) |
| void | f3DOFMagnetometerMatrixAndroid (float fR[][3], float fBc[]) |
| void | f3DOFMagnetometerMatrixWin8 (float fR[][3], float fBc[]) |
| void | feCompassNED (float fR[][3], float *pfDelta, float *pfsinDelta, float *pfcosDelta, float fBc[], float fGc[], float *pfmodBc, float *pfmodGc) |
| void | feCompassAndroid (float fR[][3], float *pfDelta, float *pfsinDelta, float *pfcosDelta, float fBc[], float fGc[], float *pfmodBc, float *pfmodGc) |
| void | feCompassWin8 (float fR[][3], float *pfDelta, float *pfsinDelta, float *pfcosDelta, float fBc[], float fGc[], float *pfmodBc, float *pfmodGc) |
| void | fNEDAnglesDegFromRotationMatrix (float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg) |
| void | fAndroidAnglesDegFromRotationMatrix (float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg) |
| void | fWin8AnglesDegFromRotationMatrix (float R[][3], float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg, float *pfChiDeg) |
| void | fQuaternionFromRotationVectorDeg (Quaternion *pq, const float rvecdeg[], float fscaling) |
| void | fQuaternionFromRotationMatrix (float R[][3], Quaternion *pq) |
| void | fRotationMatrixFromQuaternion (float R[][3], const Quaternion *pq) |
| void | fRotationVectorDegFromQuaternion (Quaternion *pq, float rvecdeg[]) |
| void | fLPFOrientationQuaternion (Quaternion *pq, Quaternion *pLPq, float flpf, float fdeltat, float fOmega[]) |
| void | qAeqBxC (Quaternion *pqA, const Quaternion *pqB, const Quaternion *pqC) |
| void | qAeqAxB (Quaternion *pqA, const Quaternion *pqB) |
| Quaternion | qconjgAxB (const Quaternion *pqA, const Quaternion *pqB) |
| void | fqAeqNormqA (Quaternion *pqA) |
| void | fqAeq1 (Quaternion *pqA) |
| void | fveqconjgquq (Quaternion *pfq, float fu[], float fv[]) |
Functions to convert between various orientation representations. Also includes functions for manipulating quaternions.
Definition in file orientation.c.
| #define CORRUPTQUAT 0.001F |
Definition at line 52 of file orientation.c.
Referenced by fqAeqNormqA().
| #define SMALLMODULUS 0.01F |
Definition at line 53 of file orientation.c.
| #define SMALLQ0 1E-4F |
Definition at line 51 of file orientation.c.
Referenced by fQuaternionFromRotationMatrix().
| void f3DOFMagnetometerMatrixAndroid | ( | float | fR[][3], |
| float | fBc[] | ||
| ) |
Android magnetometer 3DOF flat eCompass function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fBc | calibrated magnetometer reading (input) |
Definition at line 245 of file orientation.c.
Referenced by f3DOFMagnetometerMatrixWin8(), fInit_3DOF_B_BASIC(), and fRun_3DOF_B_BASIC().
Here is the call graph for this function:
Here is the caller graph for this function:| void f3DOFMagnetometerMatrixNED | ( | float | fR[][3], |
| float | fBc[] | ||
| ) |
Aerospace NED magnetometer 3DOF flat eCompass function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fBc | calibrated magnetometer reading (input) |
Definition at line 215 of file orientation.c.
Referenced by fInit_3DOF_B_BASIC(), and fRun_3DOF_B_BASIC().
Here is the call graph for this function:
Here is the caller graph for this function:| void f3DOFMagnetometerMatrixWin8 | ( | float | fR[][3], |
| float | fBc[] | ||
| ) |
Windows 8 magnetometer 3DOF flat eCompass function, computing rotation matrix fR.
| fR | computed rotation matrix (output) |
| fBc | calibrated magnetometer reading (input) |
Definition at line 275 of file orientation.c.
Referenced by fInit_3DOF_B_BASIC(), and fRun_3DOF_B_BASIC().
Here is the call graph for this function:
Here is the caller graph for this function:| void fAndroidAnglesDegFromRotationMatrix | ( | float | R[][3], |
| float * | pfPhiDeg, | ||
| float * | pfTheDeg, | ||
| float * | pfPsiDeg, | ||
| float * | pfRhoDeg, | ||
| float * | pfChiDeg | ||
| ) |
extract the Android angles in degrees from the Android rotation matrix
| R | rotation matrix input |
| pfPhiDeg | the roll angle -90.0 <= Phi <= 90.0 deg |
| pfTheDeg | the pitch angle -180.0 <= The < 180.0 deg |
| pfPsiDeg | yaw angle Psi with range 0.0 <= Psi < 360.0 deg |
| pfRhoDeg | the compass heading angle Rho equals the yaw angle Psi |
| pfChiDeg | the tilt angle from vertical Chi (0 <= Chi <= 180 deg) |
Definition at line 564 of file orientation.c.
Referenced by fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), fRun_3DOF_Y_BASIC(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void feCompassAndroid | ( | float | fR[][3], |
| float * | pfDelta, | ||
| float * | pfsinDelta, | ||
| float * | pfcosDelta, | ||
| float | fBc[], | ||
| float | fGc[], | ||
| float * | pfmodBc, | ||
| float * | pfmodGc | ||
| ) |
Android: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta.
| fR | computed rotation matrix (output) |
| pfDelta | magnetic inclination angle (output) |
| pfsinDelta | sin of the inclination angle |
| pfcosDelta | cos of the inclination angle |
| fBc | calibrated magnetometer reading (input) |
| fGc | calibrated accelerometer input vector (input) |
| pfmodBc | modulus of the calibrated magnetic vector |
| pfmodGc | modulus of the calibrated accelerometer vector |
Definition at line 359 of file orientation.c.
Referenced by fInit_6DOF_GB_BASIC(), fInit_9DOF_GBY_KALMAN(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void feCompassNED | ( | float | fR[][3], |
| float * | pfDelta, | ||
| float * | pfsinDelta, | ||
| float * | pfcosDelta, | ||
| float | fBc[], | ||
| float | fGc[], | ||
| float * | pfmodBc, | ||
| float * | pfmodGc | ||
| ) |
NED: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta.
| fR | computed rotation matrix (output) |
| pfDelta | magnetic inclination angle (output) |
| pfsinDelta | sin of the inclination angle |
| pfcosDelta | cos of the inclination angle |
| fBc | calibrated magnetometer vector (input) |
| fGc | calibrated accelerometer input vector (input) |
| pfmodBc | modulus of the calibrated magnetic vector |
| pfmodGc | modulus of the calibrated accelerometer vector |
Definition at line 286 of file orientation.c.
Referenced by fInit_6DOF_GB_BASIC(), fInit_9DOF_GBY_KALMAN(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void feCompassWin8 | ( | float | fR[][3], |
| float * | pfDelta, | ||
| float * | pfsinDelta, | ||
| float * | pfcosDelta, | ||
| float | fBc[], | ||
| float | fGc[], | ||
| float * | pfmodBc, | ||
| float * | pfmodGc | ||
| ) |
Win8: basic 6DOF e-Compass function, computing rotation matrix fR and magnetic inclination angle fDelta.
| fR | computed rotation matrix (output) |
| pfDelta | magnetic inclination angle (output) |
| pfsinDelta | sin of the inclination angle |
| pfcosDelta | cos of the inclination angle |
| fBc | calibrated magnetometer reading (input) |
| fGc | calibrated accelerometer input vector (input) |
| pfmodBc | modulus of the calibrated magnetic vector |
| pfmodGc | modulus of the calibrated accelerometer vector |
Definition at line 433 of file orientation.c.
Referenced by fInit_6DOF_GB_BASIC(), fInit_9DOF_GBY_KALMAN(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void fLPFOrientationQuaternion | ( | Quaternion * | pq, |
| Quaternion * | pLPq, | ||
| float | flpf, | ||
| float | fdeltat, | ||
| float | fOmega[] | ||
| ) |
function low pass filters an orientation quaternion and computes virtual gyro rotation rate
Definition at line 912 of file orientation.c.
Referenced by fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), and fRun_6DOF_GB_BASIC().
Here is the call graph for this function:
Here is the caller graph for this function:| void fNEDAnglesDegFromRotationMatrix | ( | float | R[][3], |
| float * | pfPhiDeg, | ||
| float * | pfTheDeg, | ||
| float * | pfPsiDeg, | ||
| float * | pfRhoDeg, | ||
| float * | pfChiDeg | ||
| ) |
extract the NED angles in degrees from the NED rotation matrix
| R | rotation matrix input |
| pfPhiDeg | output: the roll angle range -180.0 <= Phi < 180.0 deg |
| pfTheDeg | output: the pitch angle -90.0 <= Theta <= 90.0 deg |
| pfPsiDeg | output: the yaw (compass) angle 0.0 <= Psi < 360.0 deg |
| pfRhoDeg | output: For NED, the compass heading Rho equals the yaw angle Psi |
| pfChiDeg | output: the tilt angle from vertical Chi (0 <= Chi <= 180 deg) |
Definition at line 508 of file orientation.c.
Referenced by fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), fRun_3DOF_Y_BASIC(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void fqAeq1 | ( | Quaternion * | pqA | ) |
set a quaternion to the unit quaternion
Definition at line 1034 of file orientation.c.
Referenced by fInit_3DOF_Y_BASIC().
Here is the caller graph for this function:| void fqAeqNormqA | ( | Quaternion * | pqA | ) |
function normalizes a rotation quaternion and ensures q0 is non-negative
Definition at line 999 of file orientation.c.
Referenced by fLPFOrientationQuaternion(), fQuaternionFromRotationMatrix(), fRun_3DOF_Y_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| void fQuaternionFromRotationMatrix | ( | float | R[][3], |
| Quaternion * | pq | ||
| ) |
compute the orientation quaternion from a 3x3 rotation matrix
| R | Rotation matrix (input) |
| pq | Quaternion (output) |
Definition at line 781 of file orientation.c.
Referenced by fInit_3DOF_B_BASIC(), fInit_3DOF_G_BASIC(), fInit_6DOF_GB_BASIC(), fInit_6DOF_GY_KALMAN(), fInit_9DOF_GBY_KALMAN(), fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void fQuaternionFromRotationVectorDeg | ( | Quaternion * | pq, |
| const float | rvecdeg[], | ||
| float | fscaling | ||
| ) |
computes normalized rotation quaternion from a rotation vector (deg)
| pq | quaternion (output) |
| rvecdeg | rotation vector in degrees |
| fscaling | delta Time |
Definition at line 713 of file orientation.c.
Referenced by fRun_3DOF_Y_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| void fRotationMatrixFromQuaternion | ( | float | R[][3], |
| const Quaternion * | pq | ||
| ) |
compute the rotation matrix from an orientation quaternion
| R | Rotation matrix (output) |
| pq | Quaternion (input) |
Definition at line 822 of file orientation.c.
Referenced by fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), fRun_3DOF_Y_BASIC(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| void fRotationVectorDegFromQuaternion | ( | Quaternion * | pq, |
| float | rvecdeg[] | ||
| ) |
computes rotation vector (deg) from rotation quaternion
| pq | quaternion (input) |
| rvecdeg | rotation vector in degrees (output) |
Definition at line 862 of file orientation.c.
Referenced by fLPFOrientationQuaternion(), fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), fRun_3DOF_Y_BASIC(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| void fveqconjgquq | ( | Quaternion * | pfq, |
| float | fu[], | ||
| float | fv[] | ||
| ) |
function computes the rotation quaternion that rotates unit vector u onto unit vector v as v=q*.u.q using q = 1/sqrt(2) * {sqrt(1 + u.v) - u x v / sqrt(1 + u.v)}
Definition at line 1044 of file orientation.c.
Referenced by fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| void fWin8AnglesDegFromRotationMatrix | ( | float | R[][3], |
| float * | pfPhiDeg, | ||
| float * | pfTheDeg, | ||
| float * | pfPsiDeg, | ||
| float * | pfRhoDeg, | ||
| float * | pfChiDeg | ||
| ) |
extract the Windows 8 angles in degrees from the Windows 8 rotation matrix
| R | rotation matrix input |
| pfPhiDeg | the roll angle -90.0 <= Phi <= 90.0 deg |
| pfTheDeg | pitch angle Theta in the range -180.0 <= The < 180.0 deg |
| pfPsiDeg | yaw angle Psi in range 0.0 <= Psi < 360.0 deg |
| pfRhoDeg | the compass angle Rho = 360 - Psi |
| pfChiDeg | tilt angle from vertical Chi (0 <= Chi <= 180 deg) |
Definition at line 621 of file orientation.c.
Referenced by fRun_3DOF_B_BASIC(), fRun_3DOF_G_BASIC(), fRun_3DOF_Y_BASIC(), fRun_6DOF_GB_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the call graph for this function:
Here is the caller graph for this function:| void qAeqAxB | ( | Quaternion * | pqA, |
| const Quaternion * | pqB | ||
| ) |
function compute the quaternion product qA = qA * qB
Definition at line 969 of file orientation.c.
Referenced by ApplyPerturbation(), fLPFOrientationQuaternion(), fRun_3DOF_Y_BASIC(), and fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| void qAeqBxC | ( | Quaternion * | pqA, |
| const Quaternion * | pqB, | ||
| const Quaternion * | pqC | ||
| ) |
function compute the quaternion product qB * qC
Definition at line 958 of file orientation.c.
Referenced by fRun_6DOF_GY_KALMAN().
Here is the caller graph for this function:| Quaternion qconjgAxB | ( | const Quaternion * | pqA, |
| const Quaternion * | pqB | ||
| ) |
function compute the quaternion product conjg(qA) * qB
Definition at line 986 of file orientation.c.
Referenced by fLPFOrientationQuaternion().
Here is the caller graph for this function: